#!/bin/bash

if [ 0"$HL_DOWNLOAD_DIR" != "0" ]; then
  if [ ! -d "$HL_DOWNLOAD_DIR" ]; then
    echo "$HL_DOWNLOAD_DIR not exists."
    exit 1
  fi
fi

if [ 0"$HL_DATA_DIR" != "0" ]; then
  if [ ! -d "$HL_DATA_DIR" ]; then
    echo "$HL_DATA_DIR not exists."
    exit 1
  fi
fi

cd /app
python makelink.py

tail -f /dev/null

exec "$@"